﻿<Fluent:RibbonWindow x:Class="Vtron.HipcConfigurationTools.VWASStyle.MainWindow"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
                     xmlns:Vtron.HipcConfigurationTools.VWASStyle="clr-namespace:Vtron.HipcConfigurationTools.VWASStyle"
                     xmlns:Vtron.HipcConfigurationTools.Domain="clr-namespace:Vtron.HipcConfigurationTools.Domain;assembly=Vtron.HipcConfigurationTools.Domain"
                     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                     xmlns:System="clr-namespace:System;assembly=mscorlib"
                     x:Name="window"
                     Title="Hipc Codec Tools"
                     Height="720"
                     Width="1280"
                     mc:Ignorable="d"
                     ResizeMode="CanResizeWithGrip"
                     FlowDirection="LeftToRight" Icon="48x48.ico" WindowStartupLocation="CenterScreen"
                     xmlns:mui="http://firstfloorsoftware.com/ModernUI">
    <Fluent:RibbonWindow.Resources>
        <ObjectDataProvider x:Key="CodecType" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type Type="Vtron.HipcConfigurationTools.Domain:CodecType"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <ObjectDataProvider x:Key="SignalType" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type Type="Vtron.HipcConfigurationTools.Domain:SignalType"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <Vtron.HipcConfigurationTools.VWASStyle:RadioBoolToEnumConverter x:Key="RadioBoolToEnumConverter" />
        <Vtron.HipcConfigurationTools.VWASStyle:BoolToStringConverter x:Key="BoolToStringConverter" />
        <Vtron.HipcConfigurationTools.VWASStyle:BoardTypeToVisibilityConverter x:Key="BoardTypeToVisibilityConverter" />
        <Style x:Key="TextBlockStyle" TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="Margin" Value="0,0,5,0"/>
            <Setter Property="FontSize" Value="13.333"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style x:Key="TextBoxStyle" TargetType="TextBox">
            <Setter Property="Width" Value="350"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="5,3,0,3"/>
            <Setter Property="BorderThickness" Value="0,0,0,1"/>
            <Setter Property="BorderBrush" Value="Black"/>
            <Setter Property="Background" Value="{x:Null}"/>
        </Style>
        <Style x:Key="ButtonStyle1" TargetType="{x:Type Fluent:Button}" BasedOn="{StaticResource RibbonButtonStyle}" >
            <Setter Property="Template" Value="{DynamicResource ButtonControlTemplate1}"/>
        </Style>
        <ControlTemplate x:Key="ButtonControlTemplate1" TargetType="{x:Type Fluent:Button}">
            <Border x:Name="border" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Border x:Name="border1" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
                    <Grid>
                        <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
                            <Rectangle.Fill>
                                <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                                    <GradientStop Color="#7FFFFFFF" Offset="0" />
                                    <GradientStop Offset="1" />
                                </RadialGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Grid x:Name="stackPanel">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Image x:Name="iconImage" Grid.RowSpan="2" Height="50" Width="50" Source="./Images/Encodec.ico" Stretch="Fill"/>
                            <TextBlock Grid.Column="1" Text="{TemplateBinding Content}" FontSize="15" VerticalAlignment="Bottom" />
                            <TextBlock Grid.Row="1" Grid.Column="1" Text="{TemplateBinding Tag}" FontSize="13"/>
                        </Grid>
                    </Grid>
                </Border>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="Size" Value="Small">
                    <Setter Property="Width" TargetName="iconImage" Value="16" />
                    <Setter Property="Height" TargetName="iconImage" Value="16" />
                    <Setter Property="Margin" TargetName="iconImage" Value="1,0,2,0" />
                </Trigger>
                <Trigger Property="Size" Value="Middle">
                    <Setter Property="Width" TargetName="stackPanel" Value="Auto" />
                    <Setter Property="VerticalAlignment" TargetName="iconImage" Value="Center" />
                    <Setter Property="VerticalAlignment" TargetName="border" Value="Stretch" />
                    <Setter Property="Width" TargetName="iconImage" Value="16" />
                    <Setter Property="Height" TargetName="iconImage" Value="16" />
                    <Setter Property="Margin" TargetName="iconImage" Value="1,0,2,0" />
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
                    <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
                    <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
                    <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
                    <Setter Property="Effect" TargetName="iconImage">
                        <Setter.Value>
                            <Fluent:GrayscaleEffect />
                        </Setter.Value>
                    </Setter>
                </Trigger>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsMouseOver" Value="True" />
                        <Condition Property="IsPressed" Value="False" />
                        <Condition Property="IsEnabled" Value="True" />
                    </MultiTrigger.Conditions>
                    <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
                    <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
                    <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
                    <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
                    <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
                </MultiTrigger>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsKeyboardFocusWithin" Value="True" />
                        <Condition Property="IsPressed" Value="False" />
                    </MultiTrigger.Conditions>
                    <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
                    <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
                    <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
                    <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
                </MultiTrigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <Style x:Key="ButtonStyle2" TargetType="{x:Type Fluent:Button}" BasedOn="{StaticResource RibbonButtonStyle}" >
            <Setter Property="Template" Value="{DynamicResource ButtonControlTemplate2}"/>
        </Style>
        <ControlTemplate x:Key="ButtonControlTemplate2" TargetType="{x:Type Fluent:Button}">
            <Border x:Name="border" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Border x:Name="border1" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
                    <Grid>
                        <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
                            <Rectangle.Fill>
                                <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                                    <GradientStop Color="#7FFFFFFF" Offset="0" />
                                    <GradientStop Offset="1" />
                                </RadialGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Grid x:Name="stackPanel">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Image x:Name="iconImage" Grid.RowSpan="2" Height="50" Width="50" Source="./Images/Decodec.ico" Stretch="Fill"/>
                            <TextBlock Grid.Column="1" Text="{TemplateBinding Content}" FontSize="15" VerticalAlignment="Bottom" />
                            <TextBlock Grid.Row="1" Grid.Column="1" Text="{TemplateBinding Tag}" FontSize="13"/>
                        </Grid>
                    </Grid>
                </Border>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="Size" Value="Small">
                    <Setter Property="Width" TargetName="iconImage" Value="16" />
                    <Setter Property="Height" TargetName="iconImage" Value="16" />
                    <Setter Property="Margin" TargetName="iconImage" Value="1,0,2,0" />
                </Trigger>
                <Trigger Property="Size" Value="Middle">
                    <Setter Property="Width" TargetName="stackPanel" Value="Auto" />
                    <Setter Property="VerticalAlignment" TargetName="iconImage" Value="Center" />
                    <Setter Property="VerticalAlignment" TargetName="border" Value="Stretch" />
                    <Setter Property="Width" TargetName="iconImage" Value="16" />
                    <Setter Property="Height" TargetName="iconImage" Value="16" />
                    <Setter Property="Margin" TargetName="iconImage" Value="1,0,2,0" />
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
                    <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
                    <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
                    <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
                    <Setter Property="Effect" TargetName="iconImage">
                        <Setter.Value>
                            <Fluent:GrayscaleEffect />
                        </Setter.Value>
                    </Setter>
                </Trigger>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsMouseOver" Value="True" />
                        <Condition Property="IsPressed" Value="False" />
                        <Condition Property="IsEnabled" Value="True" />
                    </MultiTrigger.Conditions>
                    <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
                    <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
                    <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
                    <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
                    <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
                </MultiTrigger>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsKeyboardFocusWithin" Value="True" />
                        <Condition Property="IsPressed" Value="False" />
                    </MultiTrigger.Conditions>
                    <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
                    <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
                    <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
                    <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
                </MultiTrigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Fluent:RibbonWindow.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Fluent:Ribbon AutomaticStateManagement="True"
                       x:Name="ribbon">

            <Fluent:Ribbon.Menu>
                <Fluent:Backstage Background="Blue" FontSize="13">

                    <Fluent:BackstageTabControl SelectionChanged="BackstageTabControl_SelectionChanged">

                        <Fluent:BackstageTabItem Header="打开" FontSize="13"
                                                 Fluent:KeyTip.Keys="E">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="3"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="auto"/>
                                        <RowDefinition Height="auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="编码盒列表" FontSize="14.667" Margin="20,20,10,0"/>
                                    <Line Grid.Row="1" Height="1" Stretch="Fill" X2="1" Stroke="#cccccc" StrokeDashArray="1, 1"  StrokeThickness="2" Margin="20,5,10,0" />
                                    <ListView Grid.Row="2" Margin="20,8,10,5" FocusVisualStyle="{x:Null}" BorderThickness="0" Background="Transparent" ItemsSource="{Binding EncodecInfoes}">
                                        <ListView.Resources>
                                            <Style TargetType="{x:Type ListViewItem}">
                                                <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                                                <Setter Property="Background" Value="Transparent" />
                                                <Setter Property="BorderBrush" Value="Transparent"/>
                                                <Setter Property="BorderThickness" Value="1"/>
                                                <Setter Property="Margin" Value="0"/>
                                                <Setter Property="Foreground" Value="#333333"/>
                                                <Setter Property="Padding" Value="5,2,5,2"/>
                                                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                                                <Setter Property="VerticalContentAlignment" Value="Center"/>
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type ListViewItem}">
                                                            <Grid Background="{TemplateBinding Background}" Margin="0,5">
                                                                <Fluent:Button Content="{Binding Ip}" Tag="{Binding SignalType}" Style="{DynamicResource ButtonStyle1}" Click="OpenCodecButton_Click" IsDefinitive="False">
                                                                    <Fluent:Button.ContextMenu>
                                                                        <Fluent:ContextMenu>
                                                                            <Fluent:MenuItem Tag="{Binding Ip}" Header="连接" Click="OpenCodecButton_Click"/>
                                                                            <Fluent:MenuItem Tag="{Binding Ip}" Header="从列表中删除" Click="DeleteCodec_Click"/>
                                                                        </Fluent:ContextMenu>
                                                                    </Fluent:Button.ContextMenu>
                                                                </Fluent:Button>
                                                            </Grid>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </ListView.Resources>
                                    </ListView>
                                </Grid>

                                <GridSplitter Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  Background="#cccccc"/>

                                <Grid Grid.Column="2">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="auto"/>
                                        <RowDefinition Height="auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="解码盒列表" FontSize="14.667" Margin="20,20,10,0"/>
                                    <Line Grid.Row="1" Height="1" Stretch="Fill" X2="1" Stroke="#cccccc" StrokeDashArray="1, 1"  StrokeThickness="2" Margin="20,5,10,0" />
                                    <ListView Grid.Row="2" Margin="20,8,10,5" FocusVisualStyle="{x:Null}" BorderThickness="0" Background="Transparent" ItemsSource="{Binding DecodecInfoes}">
                                        <ListView.Resources>
                                            <Style TargetType="{x:Type ListViewItem}">
                                                <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                                                <Setter Property="Background" Value="Transparent" />
                                                <Setter Property="BorderBrush" Value="Transparent"/>
                                                <Setter Property="BorderThickness" Value="1"/>
                                                <Setter Property="Margin" Value="0"/>
                                                <Setter Property="Foreground" Value="#333333"/>
                                                <Setter Property="Padding" Value="5,2,5,2"/>
                                                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                                                <Setter Property="VerticalContentAlignment" Value="Center"/>
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type ListViewItem}">
                                                            <Grid Background="{TemplateBinding Background}" Margin="0,5">
                                                                <Fluent:Button  Content="{Binding Ip}" Tag="{Binding SignalType}" Style="{DynamicResource ButtonStyle2}" Click="OpenCodecButton_Click" IsDefinitive="False">
                                                                    <Fluent:Button.ContextMenu>
                                                                        <Fluent:ContextMenu>
                                                                            <Fluent:MenuItem Tag="{Binding Ip}" Header="连接" Click="OpenCodecButton_Click"/>
                                                                            <Fluent:MenuItem Tag="{Binding Ip}" Header="从列表中删除" Click="DeleteCodec_Click"/>
                                                                        </Fluent:ContextMenu>
                                                                    </Fluent:Button.ContextMenu>
                                                                </Fluent:Button>
                                                            </Grid>
                                                            <ControlTemplate.Triggers>
                                                            </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </ListView.Resources>
                                    </ListView>
                                </Grid>
                            </Grid>
                        </Fluent:BackstageTabItem>
                        <Fluent:BackstageTabItem Header="编辑" FontSize="13"
                                                 Fluent:KeyTip.Keys="R">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="3"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid HorizontalAlignment="Left" Margin="0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="auto"/>
                                        <RowDefinition Height="auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="编解码盒维护" FontSize="14.667" Margin="20,20,10,0"/>
                                    <Line Grid.Row="1" Height="1" Stretch="Fill" X2="1" Stroke="#cccccc" StrokeDashArray="1, 1"  StrokeThickness="2" Margin="20,5,10,20" />
                                    <Grid Grid.Row="2" Margin="20,0">
                                        <DataGrid Name="DG1" ItemsSource="{Binding CodecInfoes}" AutoGenerateColumns="False" CanUserAddRows="False">
                                            <DataGrid.Columns>
                                                <mui:DataGridTextColumn Header="Ip地址"  Binding="{Binding Ip, Mode=TwoWay}"/>
                                                <mui:DataGridComboBoxColumn Header="板卡类型" SelectedItemBinding="{Binding CodecType, Mode=TwoWay}" ItemsSource="{Binding Source={StaticResource CodecType}}" />
                                                <DataGridTemplateColumn Header="  操作">
                                                    <DataGridTemplateColumn.CellTemplate>
                                                        <DataTemplate>
                                                            <mui:ModernButton EllipseDiameter="24" IconWidth="14" IconHeight="14" Tag="{Binding Ip}" Click="DataGridDeleteButton_Click" Margin="15,0,0,0" ToolTip="删除"
                                                                              IconData="F1 M 35,19L 41,19L 41,35L 57,35L 57,41L 41,41L 41,57L 35,57L 35,41L 19,41L 19,35L 35,35L 35,19 Z">
                                                                <mui:ModernButton.RenderTransform>
                                                                    <RotateTransform CenterX="10" CenterY="10" Angle="45"/>
                                                                </mui:ModernButton.RenderTransform>
                                                            </mui:ModernButton>
                                                        </DataTemplate>
                                                    </DataGridTemplateColumn.CellTemplate>
                                                </DataGridTemplateColumn>
                                            </DataGrid.Columns>
                                        </DataGrid>
                                    </Grid>
                                </Grid>
                                <GridSplitter Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  Background="#cccccc"/>
                                <Grid Grid.Column="2" HorizontalAlignment="Left" Margin="0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="auto"/>
                                        <RowDefinition Height="auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="新增编解码盒" FontSize="14.667" Margin="20,20,10,0"/>
                                    <Line Grid.Row="1" Height="1" Stretch="Fill" X2="1" Stroke="#cccccc" StrokeDashArray="1, 1"  StrokeThickness="2" Margin="20,5,10,20" />
                                    <Grid Grid.Row="2" Margin="20,0">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <TextBlock Text="板块类型：" Style="{StaticResource TextBlockStyle}" Grid.Row="0" Grid.Column="0"/>
                                        <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="1" Margin="5,3,0,3">
                                            <RadioButton GroupName="CodecType" Margin="5,0,0,0" VerticalAlignment="Center" IsChecked="{Binding Path=CodecType, Converter={StaticResource RadioBoolToEnumConverter}, ConverterParameter=Encoded}">编码器</RadioButton>
                                            <RadioButton GroupName="CodecType" Margin="5,0,0,0" VerticalAlignment="Center" IsChecked="{Binding Path=CodecType, Converter={StaticResource RadioBoolToEnumConverter}, ConverterParameter=Decode}">解码器</RadioButton>
                                        </StackPanel>
                                        <TextBlock Text="IP地址：" Style="{StaticResource TextBlockStyle}" Grid.Row="1" Grid.Column="0"/>
                                        <Vtron.HipcConfigurationTools.VWASStyle:IPAddressControl Text="{Binding Path=AddIp, Mode=TwoWay}" Width="250" Grid.Row="1" Grid.Column="1"/>
                                        <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="1" Margin="5,20,0,3" HorizontalAlignment="Center">
                                            <Button Name="AddCodecTextBox" MinWidth="100" Command="{Binding Path=AddCodecCommand}"  Content="新增" Margin="5,0,0,0"/>
                                            <!--<Button Content="搜索网络" Command="{Binding Path=SearchNetworkCommand}"/>-->
                                        </StackPanel>
                                    </Grid>
                                </Grid>
                            </Grid>
                        </Fluent:BackstageTabItem>

                        <Fluent:BackstageTabItem Header="连接" FontSize="13"
                                                 Fluent:KeyTip.Keys="EE">
                            <Canvas x:Name="connect_Grid" MouseMove="Grid_MouseMove" Background="White" MouseRightButtonUp="connect_Grid_MouseRightButtonUp">
                                <TextBlock Grid.Row="0" Text="编解码盒连接" FontSize="14.667" Margin="20,20,10,0"/>
                                <Line Grid.Row="1" Height="1" Stretch="Fill" X2="1" Stroke="#cccccc" StrokeDashArray="1, 1"  StrokeThickness="2" Margin="20,55,0,0" Width="390"/>
                                <TextBlock Grid.Row="0" Text="编码盒列表" FontWeight="Bold" FontFamily="Segoe UI" FontSize="13"  Margin="73,80,10,0"/>
                                <ListView Grid.Row="2" Margin="40,105,10,5" FocusVisualStyle="{x:Null}" BorderThickness="0" Background="Transparent" ItemsSource="{Binding EncodecInfoes}">
                                    <ListView.Resources>
                                        <Style TargetType="{x:Type ListViewItem}">
                                            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                                            <Setter Property="Background" Value="Transparent" />
                                            <Setter Property="BorderBrush" Value="Transparent"/>
                                            <Setter Property="BorderThickness" Value="1"/>
                                            <Setter Property="Margin" Value="0"/>
                                            <Setter Property="Foreground" Value="#333333"/>
                                            <Setter Property="Padding" Value="5,2,5,2"/>
                                            <Setter Property="HorizontalContentAlignment" Value="Left"/>
                                            <Setter Property="VerticalContentAlignment" Value="Center"/>
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type ListViewItem}">
                                                        <Button Margin="0,5" Content="{Binding Ip}" MouseLeftButtonDown="Button_MouseLeftButtonDown" ClickMode="Hover" Width="130"/>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </ListView.Resources>
                                </ListView>

                                <TextBlock Grid.Row="0" Text="解码盒列表" FontWeight="Bold" FontFamily="Segoe UI" FontSize="13" Margin="293,80,10,0"/>
                                <ListView Grid.Row="2" Margin="260,105,10,5" FocusVisualStyle="{x:Null}" BorderThickness="0" Background="Transparent" ItemsSource="{Binding DecodecInfoes}">
                                    <ListView.Resources>
                                        <Style TargetType="{x:Type ListViewItem}">
                                            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                                            <Setter Property="Background" Value="Transparent" />
                                            <Setter Property="BorderBrush" Value="Transparent"/>
                                            <Setter Property="BorderThickness" Value="1"/>
                                            <Setter Property="Margin" Value="0"/>
                                            <Setter Property="Foreground" Value="#333333"/>
                                            <Setter Property="Padding" Value="5,2,5,2"/>
                                            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                                            <Setter Property="VerticalContentAlignment" Value="Center"/>
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type ListViewItem}">
                                                        <Button Margin="0,5" Content="{Binding Ip}" MouseLeftButtonUp="Button_MouseLeftButtonUp" ClickMode="Hover" Width="130"/>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </ListView.Resources>
                                </ListView>
                            </Canvas>
                        </Fluent:BackstageTabItem>
                        <Fluent:SeparatorTabItem />
                        <Fluent:BackstageTabItem Header="帮助" FontSize="13"
                                                 Fluent:KeyTip.Keys="P">
                            <Grid>
                            </Grid>
                        </Fluent:BackstageTabItem>
                        <Fluent:Button Header="退出" FontSize="12"
                                       Icon="Images\Exit.png"
                                       Click="ExitButton_Click"
                                       Fluent:KeyTip.Keys="X"/>
                    </Fluent:BackstageTabControl>
                </Fluent:Backstage>
            </Fluent:Ribbon.Menu>

            <Fluent:Ribbon.ToolBarItems>
                <Fluent:Button Size="Small"
                               Icon="Images/Help.png">
                </Fluent:Button>
            </Fluent:Ribbon.ToolBarItems>

            <Fluent:RibbonTabItem   Header="参数配置" FontSize="13" Visibility="Collapsed" x:Name="config_RibbonTabItem"
                                    Group="{Binding ElementName=tabGroup1, Mode=OneWay}"
                                    Fluent:KeyTip.Keys="H"
                                    ToolTip="参数配置"
                                    ReduceOrder="Font, Font, Font, Font,B,A,A,A,(A),(A),(A),Clipboard,Font,B,B,(A),C,(A),(A)">
                <Fluent:RibbonGroupBox Header="基础"
                                       Icon="pack://application:,,,/Vtron.HipcConfigurationTools.VWASStyle;component/Images/Default.png"
                                       Fluent:KeyTip.Keys="FG"
                                       IsLauncherVisible="True">
                    <Fluent:Button Icon="Images\clock.ico"
                                   LargeIcon="Images\clock.ico"
                                   Header="时间设置"
                                   Command="{Binding Path=ShowSetTimeCommand}"/>
                    <Fluent:Button Icon="Images\selectSignal.ico"
                                   LargeIcon="Images\selectSignal.ico"
                                   Header="选择信号源"
                                   Command="{Binding Path=ShowSelectSignalCommand}"
                                   Visibility="{Binding SystemConfigInfo.BoardType, Converter={StaticResource BoardTypeToVisibilityConverter}}"/>
                    <Fluent:Button Icon="Images\rename.gif"
                                   LargeIcon="Images\rename.gif"
                                   Header="设备名设置"
                                   Command="{Binding Path=ShowSetDevNameCommand}"/>
                    <Fluent:Button Icon="Images\export.png"
                                   LargeIcon="Images\export.png"
                                   Header="导出日志"
                                   Command="{Binding Path=ExportLogCommand}"/>
                    <Fluent:Button Icon="Images\reboot.png"
                                   LargeIcon="Images\reboot.png"
                                   Header="单板复位"
                                   Command="{Binding Path=RebootCommand}"/>
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="网络"
                                       Icon="pack://application:,,,/Vtron.HipcConfigurationTools.VWASStyle;component/Images/diqiu.png"
                                       IsLauncherVisible="True">
                    <Fluent:Button Icon="Images\diqiu.png"
                                   LargeIcon="Images\diqiu.png"
                                   Header="网络参数"
                                   Command="{Binding Path=ShowSetNetConfigCommand}"/>
                </Fluent:RibbonGroupBox>
                <Fluent:RibbonGroupBox Header="系统"
                                       Icon="pack://application:,,,/Vtron.HipcConfigurationTools.VWASStyle;component/Images/refresh.gif"
                                       IsLauncherVisible="True">
                    <Fluent:Button Icon="Images\refresh.gif"
                                   LargeIcon="Images\refresh.gif"
                                   Header="刷新"
                                   Command="{Binding Path=RefreshCommand}"/>
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>
        </Fluent:Ribbon>

        <Grid Grid.Row="1" Background="White">
            <Grid.RowDefinitions>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="6"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid Style="{StaticResource ContentRoot}">
                <ScrollViewer>
                    <StackPanel>
                        <TextBlock Text="系统信息" Style="{StaticResource Heading2}" Margin="0,0,0,8"/>
                        <Grid Margin="0,0,0,16">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <mui:BBCodeBlock BBCode="»设备类型：" Margin="0,0,0,10" FontSize="14"  Grid.Row="0" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=SystemConfigInfo.BoardType}" Margin="0,0,0,10" FontSize="14"  Grid.Row="0" Grid.Column="1"/>
                            <mui:BBCodeBlock BBCode="»系统时间：" Margin="0,0,0,10" FontSize="14"  Grid.Row="1" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=SystemConfigInfo.SysTime}" Margin="0,0,0,10" FontSize="14"  Grid.Row="1" Grid.Column="1"/>
                            <mui:BBCodeBlock BBCode="»设备名称：" Margin="0,0,0,10" FontSize="14"  Grid.Row="2" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=SystemConfigInfo.DevName}" Margin="0,0,0,10" FontSize="14"  Grid.Row="2" Grid.Column="1"/>
                        </Grid>

                        <TextBlock Text="版本信息" Style="{StaticResource Heading2}" Margin="0,0,0,8"/>
                        <Grid Margin="0,0,0,16">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <mui:BBCodeBlock BBCode="»软件：" Margin="0,0,0,10" FontSize="14"  Grid.Row="0" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=VersionInfo.Software}" Margin="0,0,0,10" FontSize="14"  Grid.Row="0" Grid.Column="1"/>
                            <mui:BBCodeBlock BBCode="»FPGA：" Margin="0,0,0,10" FontSize="14"  Grid.Row="1" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=VersionInfo.FPGA}" Margin="0,0,0,10" FontSize="14"  Grid.Row="1" Grid.Column="1"/>
                            <mui:BBCodeBlock BBCode="»硬件：" Margin="0,0,0,10" FontSize="14"  Grid.Row="2" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=VersionInfo.Hardware}" Margin="0,0,0,10" FontSize="14"  Grid.Row="2" Grid.Column="1"/>
                            <mui:BBCodeBlock BBCode="»PCBA：" Margin="0,0,0,10" FontSize="14"  Grid.Row="3" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=VersionInfo.PCBA}" Margin="0,0,0,10" FontSize="14"  Grid.Row="3" Grid.Column="1"/>
                        </Grid>

                        <TextBlock Text="网络参数" Style="{StaticResource Heading2}" Margin="0,0,0,8"/>
                        <Grid Margin="0,0,0,16">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <mui:BBCodeBlock BBCode="»是否DHCP：" Margin="0,0,0,10" FontSize="14"  Grid.Row="0" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=NetworkInfo.IsDHCP, Converter={StaticResource BoolToStringConverter}}" Margin="0,0,0,10" FontSize="14"  Grid.Row="0" Grid.Column="1"/>
                            <mui:BBCodeBlock BBCode="»IP地址：" Margin="0,0,0,10" FontSize="14"  Grid.Row="1" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=NetworkInfo.Ip}" Margin="0,0,0,10" FontSize="14"  Grid.Row="1" Grid.Column="1"/>
                            <mui:BBCodeBlock BBCode="»子网掩码：" Margin="0,0,0,10" FontSize="14"  Grid.Row="2" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=NetworkInfo.Mask}" Margin="0,0,0,10" FontSize="14"  Grid.Row="2" Grid.Column="1"/>
                            <mui:BBCodeBlock BBCode="»默认网关：" Margin="0,0,0,10" FontSize="14"  Grid.Row="3" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=NetworkInfo.Gateway}" Margin="0,0,0,10" FontSize="14"  Grid.Row="3" Grid.Column="1"/>
                            <mui:BBCodeBlock BBCode="»MAC地址：" Margin="0,0,0,10" FontSize="14"  Grid.Row="4" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=NetworkInfo.Mac}" Margin="0,0,0,10" FontSize="14"  Grid.Row="4" Grid.Column="1"/>
                        </Grid>
                    </StackPanel>
                </ScrollViewer>
            </Grid>
            <GridSplitter Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  Background="#cccccc"/>
            <Grid Style="{StaticResource ContentRoot}" Grid.Column="2">
                <ScrollViewer>
                    <StackPanel>
                        <TextBlock Text="系状态信息" Style="{StaticResource Heading2}" Margin="0,0,0,8"/>
                        <Grid Margin="0,0,0,16">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <mui:BBCodeBlock BBCode="»当前温度：" Margin="0,0,0,10" FontSize="14"  Grid.Row="0" Grid.Column="0"/>
                            <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="1">
                                <mui:BBCodeBlock BBCode="{Binding Path=SystemStatusInfo.Temperature}" Margin="0,0,0,10" FontSize="14" />
                                <mui:BBCodeBlock BBCode=" ℃" Margin="0,0,0,10" FontSize="14" />
                            </StackPanel>
                            <mui:BBCodeBlock BBCode="»运行时间：" Margin="0,0,0,10" FontSize="14"  Grid.Row="1" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=SystemStatusInfo.RunTime}" Margin="0,0,0,10" FontSize="14"  Grid.Row="1" Grid.Column="1"/>
                            <mui:BBCodeBlock BBCode="»运行状态：" Margin="0,0,0,10" FontSize="14"  Grid.Row="2" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=SystemStatusInfo.RunState}" Margin="0,0,0,10" FontSize="14"  Grid.Row="2" Grid.Column="1"/>
                            <mui:BBCodeBlock BBCode="»CPU占用率：" Margin="0,0,0,10" FontSize="14"  Grid.Row="3" Grid.Column="0"/>
                            <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="1">
                                <mui:BBCodeBlock BBCode="{Binding Path=SystemStatusInfo.CpuLoad}" Margin="0,0,0,10" FontSize="14"/>
                                <mui:BBCodeBlock BBCode=" %" Margin="0,0,0,10" FontSize="14" />
                            </StackPanel>
                            <mui:BBCodeBlock BBCode="»空余内存：" Margin="0,0,0,10" FontSize="14"  Grid.Row="4" Grid.Column="0"/>
                            <StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="1">
                                <mui:BBCodeBlock BBCode="{Binding Path=SystemStatusInfo.FreeMem}" Margin="0,0,0,10" FontSize="14"/>
                                <mui:BBCodeBlock BBCode=" MB" Margin="0,0,0,10" FontSize="14" />
                            </StackPanel>
                        </Grid>

                        <TextBlock Text="信号源信息" Style="{StaticResource Heading2}" Margin="0,0,0,8" Visibility="{Binding SystemConfigInfo.BoardType, Converter={StaticResource BoardTypeToVisibilityConverter}}"/>
                        <Grid Margin="0,0,0,16" Visibility="{Binding SystemConfigInfo.BoardType, Converter={StaticResource BoardTypeToVisibilityConverter}}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <mui:BBCodeBlock BBCode="»信号源类型：" Margin="0,0,0,10" FontSize="14"  Grid.Row="0" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=DpOrDualLink}" Margin="0,0,0,10" FontSize="14"  Grid.Row="0" Grid.Column="1"/>
                            <mui:BBCodeBlock BBCode="»分辨率：" Margin="0,0,0,10" FontSize="14"  Grid.Row="1" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=Resolution}" Margin="0,0,0,10" FontSize="14"  Grid.Row="1" Grid.Column="1"/>
                        </Grid>

                        <TextBlock Text="已连接的盒子" Style="{StaticResource Heading2}" Margin="0,0,0,8"/>
                        <Grid Margin="0,0,0,16">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <mui:BBCodeBlock BBCode="»板块Ip：" Margin="0,0,0,10" FontSize="14"  Grid.Row="0" Grid.Column="0"/>
                            <mui:BBCodeBlock BBCode="{Binding Path=ConnectionIp}" Margin="0,0,0,10" FontSize="14"  Grid.Row="0" Grid.Column="1"/>
                        </Grid>
                    </StackPanel>
                </ScrollViewer>
            </Grid>
            <!--<Grid Grid.Column="2">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBox Name="ImmediateWindow" VerticalScrollBarVisibility="Visible" IsReadOnly="True"
                 AutomationProperties.HelpText="命令窗口" FontWeight="Bold"></TextBox>
                <ComboBox Name="CommandInputBox" Grid.Row="2" IsEditable="True" LostFocus="CommandInputBox_FocusEvent" GotFocus="CommandInputBox_FocusEvent"
                  AutomationProperties.HelpText="输入命令行的文本框">
                </ComboBox>
            </Grid>-->
        </Grid>

        <Fluent:StatusBar HorizontalAlignment="Stretch"
                          VerticalAlignment="Bottom"
                          Grid.Row="2">
            <Fluent:StatusBarItem Title="Words Width"
                                  Value="150"
                                  HorizontalAlignment="Left">
                <TextBlock Text="{Binding SystemConfigInfo.BoardType}" />
            </Fluent:StatusBarItem>
            <Separator HorizontalAlignment="Left" />
            <Fluent:StatusBarItem Title="Selected Words"
                                  Value="15"
                                  ToolTip="板卡Ip"
                                  Content="{Binding Ip}"
                                  HorizontalAlignment="Left" />
            <Separator HorizontalAlignment="Left" />
        </Fluent:StatusBar>
    </Grid>
</Fluent:RibbonWindow>